package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class zajs {
   private zoz a = null;
   private zpa b;
   private com.aspose.cells.a.f.zi c;
   private zcfw d = null;
   private HashMap e = null;
   private int f;
   private ArrayList g = new ArrayList();
   private ArrayList h = new ArrayList();
   private zoy i = null;
   private zow j = null;
   private String k = null;
   private String l = null;
   private static final com.aspose.cells.b.c.a.za m = new com.aspose.cells.b.c.a.za(new String[]{"shape", "roundrect", "rect", "group", "addlxml", "allowcomments", "ext", "id", "issignatureline", "provid", "signinginstructionsset", "showsigndate", "suggestedsigner", "suggestedsigner2", "suggestedsigneremail", "signinginstructions", "sigprovurl", "br", "Anchor", "MoveWithCells", "SizeWithCells", "Locked", "PrintObject", "FmlaMacro", "FmlaPict", "AutoPict", "FmlaRange", "FmlaTxbx", "FmlaLink", "NoThreeD", "NoThreeD2", "Checked", "Min", "Max", "Inc", "Page", "Horiz", "Value", "Sel", "DropLines", "ListItem", "MultiSel", "SelType", "1", "2", "black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia", "green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"});

   zajs(zpa var1, HashMap var2, com.aspose.cells.a.f.zi var3, String var4) throws Exception {
      this.b = var1;
      this.a = var1.m;
      this.e = var2;
      this.c = var3;
      this.f = this.a.a.getWorksheets().L();
      this.d = zasr.a(var3, var4);
   }

   private void c() throws Exception {
      for(int var1 = 0; var1 < this.h.size(); var1 += 2) {
         Object var2 = this.h.get(var1);
         String var3 = (String)this.h.get(var1 + 1);
         if (var2 instanceof Shape) {
            ((Picture)var2).setData(this.b(var3));
         } else if (var2 instanceof zox) {
            this.a((zox)var2, var3);
         } else if (var2 instanceof FillFormat) {
            ((FillFormat)var2).setImageData(this.b(var3));
         }
      }

   }

   void a() throws Exception {
      if (null != this.d) {
         this.d.j();
         if (this.d.d()) {
            zbva var1 = new zbva();

            while(this.d.r() != 4) {
               if (this.d.r() != 1) {
                  this.d.a();
               } else {
                  zcfq var2 = this.d.a((zcft)var1, false);
                  zcfl var3 = (zcfl)var2;
                  switch(m.a(var3.g)) {
                  case 0:
                  case 1:
                  case 2:
                     this.a((ArrayList)null, (zcfl)var3);
                     break;
                  case 3:
                     this.a(var3);
                     break;
                  default:
                     this.b(var3);
                  }
               }
            }

            this.d.c();
            this.c();
         }
      }
   }

   void a(zcfl var1) throws Exception {
      ShapeCollection var2 = this.b.d.getShapes();
      Shape var3 = var2.a(0, 4095);
      var3.g = new zpq();
      this.a(var1, var3);
      zcfs var4 = var1.j();
      ArrayList var5 = new ArrayList();

      for(int var6 = 0; var6 < var4.a(); ++var6) {
         if (var4.a(var6) instanceof zcfl) {
            zcfl var7 = (zcfl)var4.a(var6);
            String var8 = var7.g;
            switch(m.a(var8)) {
            case 0:
            case 1:
            case 2:
               this.a(var5, var7);
               break;
            case 3:
               this.a(var7);
            }
         }
      }

      GroupShape var13 = (GroupShape)var3;
      if (var5.size() > 0) {
         int var14 = var13.a().a;
         int var15 = var13.a().c;
         int var9 = var13.a().b;
         int var10 = var13.a().d;

         for(int var11 = 0; var11 < var5.size(); ++var11) {
            var3 = (Shape)var5.get(var11);
            int[] var12 = var3.G();
            var3.a(0, false, (int)((double)((float)(var12[0] - var14) * 4000.0F / (float)var9) + 0.5D), (int)((double)((float)(var12[1] - var15) * 4000.0F / (float)var10) + 0.5D), (int)((double)((float)var12[2] * 4000.0F / (float)var9) + 0.5D), (int)((double)((float)var12[3] * 4000.0F / (float)var10) + 0.5D));
            var13.a(var3);
         }
      }

   }

   private void a(ArrayList var1, zcfl var2) throws Exception {
      this.i = null;
      this.l = null;
      this.k = null;
      this.j = null;
      Shape var3 = this.c(var2);
      if (var1 != null && var3 != null) {
         com.aspose.cells.b.a.a.ze.a(var1, (Object)var3);
      }

      if (var3 == null) {
         this.b(var2);
         if (var3 == null) {
            return;
         }
      }

      this.a(var2, var3);
      this.c(var2, var3);
   }

   private void b(zcfl var1) throws Exception {
      if (this.e != null) {
         String var2 = zass.a(var1, true);
         com.aspose.cells.b.a.a.zc var3 = com.aspose.cells.b.a.a.zf.a(this.e);

         while(var3.c()) {
            String var4 = (String)var3.a();
            if (var2.indexOf(var4) != -1 && !this.g.contains(var3.b())) {
               com.aspose.cells.b.a.a.ze.a(this.g, var3.b());
            }
         }

      }
   }

   private void a(zcfl var1, Shape var2) {
      String var3 = null;
      String var4 = null;
      String var5 = null;
      String var6 = null;
      String var7 = null;
      Iterator var8 = var1.e().iterator();

      while(var8.hasNext()) {
         zcfg var9 = (zcfg)var8.next();
         String var10 = var9.g;
         String var11 = zase.b(var9.h);
         if (var10.equals("id")) {
            if (var2.getMsoDrawingType() != 25 && var2.getMsoDrawingType() != 8) {
               com.aspose.cells.b.a.a.ze.a(this.b.d.g.n, (Object)var11);
            }

            var2.g.a = var11;
         } else if (var10.equals("spid")) {
            var2.g.b = var11;
         } else if (var10.equals("alt")) {
            var2.setAlternativeText(var11);
         } else if (var10.equals("style")) {
            this.a(var11, var2);
         } else if (var10.equals("href")) {
            var2.addHyperlink(var11);
         } else if (var10.equals("filled")) {
            var2.getFillFormat().setVisible(zase.ax(var11));
            var6 = var11;
         } else if (var10.equals("fillcolor")) {
            var3 = var11;
         } else if (var10.equals("stroked")) {
            if (var11.equals("f")) {
               var2.getLineFormat().setVisible(false);
            } else if (var11.equals("t")) {
               var2.getLineFormat().setVisible(true);
            }

            var7 = var11;
         } else if (var10.equals("strokecolor")) {
            var4 = var11;
         } else if (var10.equals("strokeweight")) {
            var5 = var11;
         } else if (var10.equals("insetmode")) {
            if ("auto".equals(var11)) {
               var2.q = true;
            }
         } else {
            String[] var12;
            GroupShape var13;
            if ("coordorigin".equals(var10)) {
               if (var2 instanceof GroupShape) {
                  var12 = com.aspose.cells.b.a.zv.d(var11, ',');
                  var13 = (GroupShape)var2;
                  var13.a().a = zase.C(var12[0]);
                  var13.a().c = zase.C(var12[1]);
               }
            } else if ("coordsize".equals(var10) && var2 instanceof GroupShape) {
               var12 = com.aspose.cells.b.a.zv.d(var11, ',');
               var13 = (GroupShape)var2;
               var13.a().b = zase.C(var12[0]);
               var13.a().d = zase.C(var12[1]);
            }
         }
      }

      if (var2.g.b != null) {
         com.aspose.cells.b.a.a.ze.a(this.b.d.g.o, (Object)var2.g.b);
         if (var2.g.a != null) {
            var2.setName(var2.g.a);
         }
      } else if (var2.g.a != null) {
         com.aspose.cells.b.a.a.ze.a(this.b.d.g.o, (Object)var2.g.a);
      }

      if (var2.getMsoDrawingType() == 11 || var2.getMsoDrawingType() == 12) {
         if (var6 == null) {
            var2.getFillFormat().setVisible(true);
         }

         if (var7 == null) {
            var2.getLineFormat().setVisible(true);
         }
      }

      if (var2.getMsoDrawingType() == 24) {
         if (var6 == null) {
            var2.getFillFormat().setVisible(false);
         }

         if (var7 == null) {
            var2.getLineFormat().setVisible(false);
         }
      }

      Color var14;
      if (var2.getFillFormat().isVisible() && var3 != null && var3.indexOf("window") == -1) {
         var14 = this.a(var3, this.a.a.getWorksheets());
         if (!var14.isEmpty()) {
            var2.getFill().setType(2);
            var2.getFill().getSolidFill().setColor(var14);
         }
      }

      if (var2.getLineFormat().isVisible()) {
         if (var4 != null && var4.indexOf("window") == -1) {
            var14 = this.a(var4, this.a.a.getWorksheets());
            if (!var14.isEmpty()) {
               var2.getLineFormat().setForeColor(var14);
            }
         }

         if (var5 != null && var5.indexOf(44) == -1) {
            var2.getLineFormat().setWeight(a(var5, "pt", this.f));
         }
      }

   }

   private Shape c(zcfl var1) throws Exception {
      this.k = var1.a("id", (String)null);
      this.l = var1.a("spid", (String)null);
      this.i = this.b.a(this.k, this.l, true);
      if (this.i != null) {
         this.j = this.i.o;
      }

      if (this.j == null) {
         this.j = this.b.a(this.k, this.l);
      }

      Object var2 = null;
      ShapeCollection var3 = this.b.d.getShapes();
      zcfl var4 = zase.b((zcfq)var1, "ClientData");
      byte var5 = 29;
      if (var4 != null) {
         String var6 = zase.a((zcfq)var4, (String)"ObjectType");
         if ("Note".equals(var6)) {
            zcfl var7 = zase.b((zcfq)var4, "Row");
            zcfl var8 = zase.b((zcfq)var4, "Column");
            if (var7 != null && var8 != null) {
               String var9 = zase.b(zass.a((zcfq)var7));
               String var10 = zase.b(zass.a((zcfq)var8));
               if (var9 != null && var10 != null) {
                  int var11 = zase.C(var9);
                  int var12 = zase.C(var10);
                  CommentCollection var13 = this.b.d.getComments();
                  int var14 = var13.getCount();

                  for(int var15 = 0; var15 < var14; ++var15) {
                     Comment var16 = var13.get(var15);
                     if (var16.getRow() == var11 && var16.getColumn() == var12) {
                        var2 = var16.getCommentShape();
                        break;
                     }
                  }
               }
            }
         } else if ("Pict".equals(var6)) {
            var2 = this.d(var1);
         } else if ("Checkbox".equals(var6)) {
            var5 = 11;
         } else if ("Label".equals(var6)) {
            var5 = 14;
         } else if ("Button".equals(var6)) {
            var5 = 7;
         } else if ("Drop".equals(var6)) {
            var5 = 20;
         } else if ("Spin".equals(var6)) {
            var5 = 16;
         } else if ("List".equals(var6)) {
            var5 = 18;
         } else if ("Radio".equals(var6)) {
            var5 = 12;
         } else if ("GBox".equals(var6)) {
            var5 = 19;
         } else if ("Scroll".equals(var6)) {
            var5 = 17;
         }
      }

      if (var2 != null) {
         ((Shape)var2).g = new zpq();
      } else if (var5 != 29) {
         var2 = this.a(var5, 4095);
      }

      return (Shape)var2;
   }

   private Shape a(int var1, int var2) {
      ShapeCollection var3 = this.b.d.getShapes();
      int var4 = var3.getCount();
      Shape var5 = var3.a(var1, 4095);
      var5.g = new zpq();
      if (this.i != null) {
         var3.d(var4);
         Shape var6 = this.i.P;
         var3.b(this.i.P);
         var3.a(this.i.a, var5);
         if (var6.n instanceof GroupShape) {
            ((GroupShape)var6.n).a(var5);
         }

         var5.k.h().a(var6.k.h());
         if (var3.e() == var5.K()) {
            var3.b(var3.e() - 1);
         }

         var5.f(var6.K());
      }

      if (this.j != null && this.j instanceof zpf) {
         var5.x = (zpf)this.j;
         var5.x.k = var5;
      }

      return var5;
   }

   private String a(String var1) {
      if (var1 != null) {
         zqe var2 = zajh.b(this.e, var1);
         if (var2 != null) {
            return var2.e;
         }
      }

      return null;
   }

   private byte[] b(String var1) throws Exception {
      Object var2 = null;
      String var3 = "xl" + var1.substring(2);
      com.aspose.cells.a.f.zh var4 = this.c.a(var3);
      if (var4 == null) {
         return null;
      } else {
         com.aspose.cells.b.a.d.zm var5 = this.c.a(var4);
         byte[] var6 = new byte[(int)var4.a()];
         var5.a(var6, 0, (int)var4.a());
         var5.a();
         return var6;
      }
   }

   private void a(zox var1, String var2) throws Exception {
      OleObject var3 = var1.m;
      Object var4 = null;
      String var5 = null;
      if (var2 != null) {
         var5 = "xl" + var2.substring(2);
         com.aspose.cells.a.f.zh var6 = this.c.a(var5);
         com.aspose.cells.b.a.d.zm var7 = this.c.a(var6);
         byte[] var10 = new byte[(int)var6.a()];
         var7.a(var10, 0, (int)var6.a());
         var7.a();
         int var8 = this.a.a.getWorksheets().Q().a(var10);
         var3.a(var8);
      }

      if (var1.c != null) {
         String var11 = var1.c;
         var11 = "xl" + var11.substring(2);
         com.aspose.cells.a.f.zh var12 = this.c.a(var11);
         com.aspose.cells.b.a.d.zm var13 = this.c.a(var12);
         byte[] var9 = new byte[(int)var12.a()];
         var13.a(var9, 0, (int)var12.a());
         var13.a();
         var3.a(var9);
         if (!var3.k()) {
            var3.b(com.aspose.cells.b.a.d.zk.b(var11));
         }

         com.aspose.cells.b.a.a.ze.a(this.a.a.b.g, (Object)com.aspose.cells.b.a.d.zk.b(var11));
      }

      if (var1.g != null) {
         var3.c(var1.g);
         if ("OLEUPDATE_ALWAYS".equals(var1.h)) {
            var3.c(true);
         } else if ("OLEUPDATE_ONCALL".equals(var1.h)) {
            var3.c(false);
         }
      } else {
         var3.c(var1.k);
         var3.setLink(var1.j);
         if (var1.l != null) {
            var3.b(var1.l);
         }
      }

      if (var1.f != null) {
         var3.setProgID(var1.f);
      }

      if ("DVASPECT_ICON".equals(var1.i)) {
         var3.setDisplayAsIcon(true);
      }

      if (var5 != null) {
         com.aspose.cells.b.a.a.ze.a(this.a.a.b.h, (Object)com.aspose.cells.b.a.d.zk.b(var5));
      }

   }

   private Shape d(zcfl var1) throws Exception {
      if (this.i != null && this.i.d != null) {
         this.i.P.g.a = this.k;
         this.i.P.g.b = this.l;
         return null;
      } else {
         String var2 = null;
         if (this.j != null) {
            var2 = this.j.d;
         }

         if (var2 == null) {
            String var3 = null;
            zcfl var4 = zase.b((zcfq)var1, "imagedata");
            if (var4 != null) {
               var3 = zase.a((zcfq)var4, (String)"relid");
            }

            var2 = this.a(var3);
         }

         if (this.j instanceof zox) {
            zox var10 = (zox)this.j;
            Object var11 = var10.m;
            if (var11 == null) {
               var11 = this.a(24, 4095);
               OleObject var12 = (OleObject)var11;
               if (var10.c != null) {
                  String var6 = var10.c;
                  var6 = "xl" + var6.substring(2);
                  com.aspose.cells.a.f.zh var7 = this.c.a(var6);
                  if (var7 == null) {
                     return null;
                  }
               }

               var10.m = var12;
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var10);
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var2);
            } else {
               ((Shape)var11).setHidden(false);
            }

            return (Shape)var11;
         } else {
            int var8 = -1;
            int var9 = -1;
            if (this.k != null) {
               var8 = zase.ab(this.k);
            }

            if (this.l != null) {
               var9 = zase.ab(this.l);
            }

            if (var8 == -1 && var9 == -1) {
               return null;
            } else if (var2 != null) {
               Shape var5 = this.a(8, 4095);
               if (this.i == null) {
                  var5.g(0);
               }

               com.aspose.cells.b.a.a.ze.a(this.b.d.g.p, (Object)(this.k + "|" + this.l));
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var5);
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var2);
               return var5;
            } else {
               return null;
            }
         }
      }
   }

   private void a(String var1, Shape var2) {
      short var3 = 0;
      short var4 = 0;
      short var5 = 0;
      short var6 = 0;
      String[] var7 = com.aspose.cells.b.a.zv.d(var1, ';');

      for(int var8 = 0; var8 < var7.length; ++var8) {
         String[] var9 = com.aspose.cells.b.a.zv.d(var7[var8], ':');
         if (var9.length == 2) {
            String var10 = var9[0].trim();
            if (!"margin-left".equals(var10) && !"left".equals(var10)) {
               if (!"margin-top".equals(var10) && !"top".equals(var10)) {
                  if ("width".equals(var10)) {
                     var5 = (short)((int)a(var9[1], "px", this.f));
                  } else if ("height".equals(var10)) {
                     var6 = (short)((int)a(var9[1], "px", this.f));
                  } else if ("z-index".equals(var10)) {
                     try {
                        var2.g.d = zase.C(var9[1]);
                     } catch (Exception var12) {
                        ;
                     }
                  } else if ("visibility".equals(var10)) {
                     if (var2.getMsoDrawingType() == 25) {
                        if (var9[1].trim().equals("visible")) {
                           ((CommentShape)var2).a().setVisible(true);
                        }
                     } else if (var9[1].trim().equals("hidden")) {
                        var2.setHidden(true);
                     }
                  }
               } else {
                  var4 = (short)((int)a(var9[1], "px", this.f));
               }
            } else {
               var3 = (short)((int)a(var9[1], "px", this.f));
            }
         }
      }

      if (this.i == null) {
         var2.a(0, false, var3, var4, var5, var6);
      }

   }

   static double a(String var0, String var1, int var2) {
      String var3 = "px";
      if (var0.length() > 2) {
         String var6 = var0.substring(var0.length() - 2);
         char var7 = var6.charAt(0);
         char var8 = var6.charAt(1);
         if (var7 < '0' || var7 > '9' || var8 < '0' || var8 > '9') {
            var3 = var6;
            var0 = var0.substring(0, 0 + (var0.length() - 2));
         }
      }

      double var4 = zase.B(var0);
      if ("px".equals(var3)) {
         var4 = var4 * 72.0D / (double)var2;
      } else if (!"pt".equals(var3)) {
         if ("in".equals(var3)) {
            var4 *= 72.0D;
         } else if ("mm".equals(var3)) {
            var4 = var4 / 10.0D / 2.54D * 72.0D;
         } else if ("cm".equals(var3)) {
            var4 = var4 / 2.54D * 72.0D;
         }
      }

      if ("px".equals(var1)) {
         var4 = var4 * (double)var2 / 72.0D;
      } else if ("in".equals(var1)) {
         var4 /= 72.0D;
      } else if ("mm".equals(var1)) {
         var4 = var4 / 72.0D * 2.54D * 10.0D;
      } else if ("cm".equals(var1)) {
         var4 = var4 / 72.0D * 2.54D;
      }

      return var4;
   }

   private void b(zcfl var1, Shape var2) {
      Iterator var3 = var1.e().iterator();

      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         String var5 = var4.g;
         String var6 = zase.b(var4.h);
         if (var5.equals("opacity")) {
            if (var2.getFillFormat().isVisible()) {
               double var7 = c(var6);
               if (var7 > -1.0D) {
                  if (var2.getFill().getType() == 0) {
                     var2.getFill().setType(2);
                  }

                  var2.getFillFormat().a(var7);
               }
            }
         } else if (var5.equals("relid")) {
            String var9 = this.a(var6);
            if (var9 != null) {
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var2.getFill());
               com.aspose.cells.b.a.a.ze.a(this.h, (Object)var9);
            }
         }
      }

   }

   private static double c(String var0) {
      try {
         if (var0.endsWith("f")) {
            var0 = var0.substring(0, 0 + (var0.length() - 1));
            int var5 = zase.C(var0);
            double var2 = (double)var5 / 65536.0D;
            return var2;
         } else {
            double var1 = zase.B(var0);
            return var1;
         }
      } catch (Exception var4) {
         return -1.0D;
      }
   }

   private void c(zcfl var1, Shape var2) throws Exception {
      zcfs var3 = var1.j();

      for(int var4 = 0; var4 < var3.a(); ++var4) {
         if (var3.a(var4) instanceof zcfl) {
            zcfl var5 = (zcfl)var3.a(var4);
            String var6 = var5.g;
            if (var6.equals("fill")) {
               this.b(var5, var2);
            } else if (var6.equals("stroke")) {
               this.g(var5, var2);
            } else if (var6.equals("imagedata")) {
               this.e(var5, var2);
            } else if (var6.equals("ClientData")) {
               this.f(var5, var2);
            } else if (var6.equals("textbox")) {
               zcfl var7 = zase.b((zcfq)var1, "ClientData");
               this.a(var5, var7, var2);
            } else if (var6.equals("signatureline")) {
               this.d(var5, var2);
            } else if (var6.equals("shadow")) {
               var2.z = zase.b(var1.b("on"), true);
            }
         }
      }

   }

   private void d(zcfl var1, Shape var2) {
      if (var2.getMsoDrawingType() == 8) {
         SignatureLine var3 = new SignatureLine();
         boolean var4 = false;
         String var5 = null;
         Iterator var6 = var1.e().iterator();

         while(var6.hasNext()) {
            zcfg var7 = (zcfg)var6.next();
            switch(m.a(var7.g)) {
            case 4:
               var3.d = var7.h;
               break;
            case 5:
               var3.setAllowComments(zase.ax(var7.h));
               break;
            case 6:
               var3.a = var7.h;
               break;
            case 7:
               var3.b = zase.aR(var7.h);
               break;
            case 8:
               var3.setLine(zase.ax(var7.h));
               break;
            case 9:
               var3.setProviderId(zase.aR(var7.h));
               break;
            case 10:
               var4 = zase.ax(var7.h);
               break;
            case 11:
               var3.setShowSignedDate(zase.ax(var7.h));
               break;
            case 12:
               var3.setSigner(var7.h);
               break;
            case 13:
               var3.setTitle(var7.h);
               break;
            case 14:
               var3.setEmail(var7.h);
               break;
            case 15:
               var5 = var7.h;
               break;
            case 16:
               var3.c = var7.h;
            }
         }

         if (var4) {
            var3.setInstructions(var5);
         }

         ((Picture)var2).b = var3;
      }
   }

   private void e(zcfl var1, Shape var2) {
      Iterator var3 = var1.e().iterator();

      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         String var5 = var4.i();
         String var6 = zase.b(var4.h);
         if (var5.equals("cropleft")) {
            var2.getFormatPicture().setLeftCrop(zajc.b(var6));
         } else if (var5.equals("cropright")) {
            var2.getFormatPicture().setRightCrop(zajc.b(var6));
         } else if (var5.equals("croptop")) {
            var2.getFormatPicture().setTopCrop(zajc.b(var6));
         } else if (var5.equals("cropbottom")) {
            var2.getFormatPicture().setBottomCrop(zajc.b(var6));
         } else if (var5.equals("gain")) {
            var2.g.l = var6;
         } else if (var5.equals("blacklevel")) {
            var2.g.m = var6;
         }
      }

   }

   private void a(zcfl var1, zcfl var2, Shape var3) throws Exception {
      zbtz var4 = null;
      switch(var3.getMsoDrawingType()) {
      case 7:
         var4 = ((Button)var3).aa();
         break;
      case 8:
      case 9:
      case 10:
      case 13:
      case 15:
      case 16:
      case 17:
      case 18:
      case 20:
      case 21:
      case 22:
      case 23:
      case 24:
      default:
         return;
      case 11:
         var4 = ((CheckBox)var3).aa();
         break;
      case 12:
         var4 = ((RadioButton)var3).aa();
         break;
      case 14:
         var4 = ((Label)var3).aa();
         break;
      case 19:
         var4 = ((GroupBox)var3).aa();
         break;
      case 25:
         var4 = var3.aa();
      }

      zcfl var5;
      String var6;
      String var7;
      if (var2 != null) {
         var5 = zase.b((zcfq)var2, "TextVAlign");
         if (var5 != null) {
            var6 = zase.b(zass.a((zcfq)var5));
            var4.f(zase.ag(var6));
         }

         zcfl var15 = zase.b((zcfq)var2, "TextHAlign");
         if (var15 != null) {
            var7 = zase.b(zass.a((zcfq)var15));
            var4.e(zase.ag(var7));
         }
      }

      var5 = zase.b((zcfq)var1, "div");
      if (var5 != null && (var3.getMsoDrawingType() != 25 || var4.i() == null || var4.i().equals(""))) {
         int var16 = 0;
         StringBuilder var17 = new StringBuilder();
         zcfs var8 = var5.j();

         for(int var9 = 0; var9 < var8.a(); ++var9) {
            if (var8.a(var9) instanceof zcfl) {
               zcfl var10 = (zcfl)var8.a(var9);
               String var11 = var10.g;
               if (var11.equals("font")) {
                  zqg var12 = this.e(var10);
                  var17.append(var12.b);
                  int var13 = var12.b.length();
                  FontSetting var14 = var4.a(var16, var13);
                  if (var12.a != null) {
                     var12.a.a(var14.getFont());
                  }

                  var16 += var13;
               }
            }
         }

         var4.c(com.aspose.cells.b.a.zr.a(var17));
      }

      var6 = zase.a((zcfq)var1, (String)"inset");
      if (var6 != null) {
         String[] var18 = com.aspose.cells.b.a.zv.d(var6, ',');
         if (var18.length == 4) {
            MsoTextFrame var19 = var3.getTextFrame();
            var19.setLeftMarginPt(a(var18[0], "pt", var3.L().L()));
            var19.setTopMarginPt(a(var18[1], "pt", var3.L().L()));
            var19.setRightMarginPt(a(var18[2], "pt", var3.L().L()));
            var19.setBottomMarginPt(a(var18[3], "pt", var3.L().L()));
            var19.setAutoMargin(false);
         }
      }

      var7 = zase.a((zcfq)var1, (String)"style");
      if (var7 != null) {
         if (var7.indexOf("mso-fit-shape-to-text:t") != -1) {
            var3.getTextFrame().a(true);
         }

         int var20 = var7.indexOf("mso-direction-alt:");
         if (var20 >= 0) {
            var20 += "mso-direction-alt:".length();
            if (var7.charAt(var20) == 'R') {
               var3.setTextDirection(2);
            } else if (var7.charAt(var20) == 'L') {
               var3.setTextDirection(1);
            }
         }
      }

   }

   private zqg e(zcfl var1) throws Exception {
      zqg var2 = new zqg();
      var2.a = new zoo();
      String var3 = zase.a((zcfq)var1, (String)"face");
      if (var3 != null) {
         var2.a.d(var3);
      }

      String var4 = zase.a((zcfq)var1, (String)"size");
      if (var4 != null) {
         var2.a.a((double)((int)(zase.B(var4) / 20.0D)));
      }

      String var5 = zase.a((zcfq)var1, (String)"color");
      if (var5 != null && !"auto".equals(var5)) {
         try {
            int var6;
            zakp var7;
            if (var5.startsWith("#")) {
               var6 = com.aspose.cells.b.a.zo.a(var5.substring(1), 515);
               var7 = new zakp(false);
               var7.a(2, var6);
               var2.a.a(var7);
            } else {
               var6 = zase.C(var5);
               var7 = new zakp(false);
               var7.a(2, this.a.a.getWorksheets().m().e(var6).toArgb());
               var2.a.a(var7);
            }
         } catch (Exception var8) {
            ;
         }
      }

      StringBuilder var9 = new StringBuilder();
      a(var9, var1);
      var2.b = com.aspose.cells.b.a.zr.a(var9);
      return var2;
   }

   private static void a(StringBuilder var0, zcfl var1) {
      Iterator var2 = var1.iterator();

      while(true) {
         String var4;
         label40:
         do {
            while(var2.hasNext()) {
               zcfq var3 = (zcfq)var2.next();
               switch(var3.e) {
               case 1:
                  switch(m.a(var3.g)) {
                  case 17:
                     var0.append("\r\n");
                     continue;
                  default:
                     a(var0, (zcfl)var3);
                     continue;
                  }
               case 3:
                  var4 = var3.h;
                  continue label40;
               }
            }

            return;
         } while(var4 == null);

         char[] var5 = var4.toCharArray();

         label56:
         for(int var6 = 0; var6 < var5.length; ++var6) {
            switch(var5[var6]) {
            case '\n':
            case '\r':
               break;
            case ' ':
            case ' ':
               var0.append(' ');
               boolean var7 = true;
               ++var6;

               while(true) {
                  if (var6 >= var5.length || !var7) {
                     continue label56;
                  }

                  switch(var5[var6]) {
                  case '\n':
                  case '\r':
                  case ' ':
                  case ' ':
                     ++var6;
                     break;
                  default:
                     var0.append(var5[var6]);
                     var7 = false;
                  }
               }
            default:
               var0.append(var5[var6]);
            }
         }
      }
   }

   private void f(zcfl var1, Shape var2) {
      boolean var3 = true;
      boolean var4 = true;
      boolean var5 = false;
      boolean var6 = true;
      String var7 = null;
      String var8 = null;
      String var9 = null;
      String var10 = null;
      String var11 = null;
      boolean var12 = false;
      String var13 = null;
      String var14 = null;
      String var15 = null;
      ArrayList var16 = null;
      String var17 = null;
      String var18 = null;
      String[] var19 = null;
      zcfs var20 = var1.j();

      String var24;
      for(int var21 = 0; var21 < var20.a(); ++var21) {
         if (var20.a(var21) instanceof zcfl) {
            zcfl var22 = (zcfl)var20.a(var21);
            String var23 = var22.g;
            var24 = zass.a((zcfq)var22).trim();
            switch(m.a(var23)) {
            case 18:
               var19 = com.aspose.cells.b.a.zv.d(var24, ',');
               break;
            case 19:
               if (var24 != null && !"".equals(var24)) {
                  var3 = !zase.ax(var24);
                  break;
               }

               var3 = false;
               break;
            case 20:
               if (var24 != null && !"".equals(var24)) {
                  var4 = !zase.ax(var24);
                  break;
               }

               var4 = false;
               break;
            case 21:
               if ("False".equals(var24)) {
                  var2.setLocked(false);
               }
               break;
            case 22:
               if ("False".equals(var24)) {
                  var2.setPrintable(false);
               }
               break;
            case 23:
               var2.d(var24);
               break;
            case 24:
               var2.f(var24);
               break;
            case 25:
               var5 = zase.b(var24, true);
               break;
            case 26:
               var2.setInputRange(var24);
               break;
            case 27:
            case 28:
               var2.e(var24);
               break;
            case 29:
            case 30:
               var6 = true;
               break;
            case 31:
               var7 = var24;
               break;
            case 32:
               var8 = var24;
               break;
            case 33:
               var9 = var24;
               break;
            case 34:
               var10 = var24;
               break;
            case 35:
               var11 = var24;
               break;
            case 36:
               var12 = true;
               break;
            case 37:
               var13 = var24;
               break;
            case 38:
               var14 = var24;
               break;
            case 39:
               var15 = var24;
               break;
            case 40:
               if (var16 == null) {
                  var16 = new ArrayList();
               }

               com.aspose.cells.b.a.a.ze.a(var16, (Object)var24);
               break;
            case 41:
               var17 = var24;
               break;
            case 42:
               var18 = var24;
            }
         }
      }

      var2.z = var6;
      int var29;
      label225:
      switch(var2.getMsoDrawingType()) {
      case 11:
         CheckBox var32 = (CheckBox)var2;
         if (var7 != null) {
            byte var37 = 0;
            switch(m.a(var7)) {
            case 43:
               var37 = 1;
               break;
            case 44:
               var37 = 2;
            }

            var32.a(var37);
         }
         break;
      case 12:
         RadioButton var31 = (RadioButton)var2;
         var31.a(zase.b(var7, false));
      case 13:
      case 14:
      case 15:
      case 19:
      case 21:
      case 22:
      case 23:
      default:
         break;
      case 16:
         Spinner var30 = (Spinner)var2;
         if (var13 != null) {
            var30.a(zase.C(var13));
         }

         if (var8 != null) {
            var30.setMin(zase.C(var8));
         }

         if (var9 != null) {
            var30.setMax(zase.C(var9));
         }

         if (var10 != null) {
            var30.setIncrementalChange(zase.C(var10));
         }

         if (var11 != null) {
            var30.b(zase.C(var11));
         }
         break;
      case 17:
         ScrollBar var28 = (ScrollBar)var2;
         if (var10 != null) {
            var28.setIncrementalChange(zase.C(var10));
         }

         if (var11 != null) {
            var28.setPageChange(zase.C(var11));
         }

         var28.setHorizontal(var12);
         if (var9 != null) {
            var28.setMax(zase.C(var9));
         }

         if (var8 != null) {
            var28.setMin(zase.C(var8));
         }

         if (var13 != null) {
            var28.setCurrentValue(zase.C(var13));
         }
         break;
      case 18:
         ListBox var27 = (ListBox)var2;
         var29 = -1;
         if (var13 != null) {
            var27.b(zase.C(var13));
         }

         if (var8 != null) {
            var27.c(zase.C(var8));
         }

         if (var9 != null) {
            var27.d(zase.C(var9));
         }

         if (var10 != null) {
            var27.e(zase.C(var10));
         }

         if (var11 != null) {
            var27.setPageChange(zase.C(var11));
         }

         if (var14 != null) {
            var29 = zase.C(var14);
         }

         if (var18 != null) {
            var27.setSelectionType(zase.av(var18));
         }

         if (var27.v != null) {
            int var25;
            String[] var36;
            ArrayList var38;
            switch(var27.getSelectionType()) {
            case 0:
               if (var29 > 0) {
                  var27.setSelectedIndex(var29 - 1);
               }
               break label225;
            case 1:
               if (var17 != null) {
                  var36 = com.aspose.cells.b.a.zv.d(var17, ',');
                  var38 = new ArrayList(var36.length);

                  for(var25 = 0; var25 < var36.length; ++var25) {
                     com.aspose.cells.b.a.a.ze.a(var38, (Object)((com.aspose.cells.b.a.zo.a(var36[var25].trim(), com.aspose.cells.b.a.c.za.b()) & '\uffff') - 1));
                  }

                  var27.a(var38);
               }
               break label225;
            case 2:
               if (var29 > 0) {
                  var27.setSelectedIndex(var29 - 1);
               }

               if (var17 != null) {
                  var36 = com.aspose.cells.b.a.zv.d(var17, ',');
                  var38 = new ArrayList(var36.length);

                  for(var25 = 0; var25 < var36.length; ++var25) {
                     com.aspose.cells.b.a.a.ze.a(var38, (Object)((com.aspose.cells.b.a.zo.a(var36[var25].trim(), com.aspose.cells.b.a.c.za.b()) & '\uffff') - 1));
                  }

                  var27.a(var38);
               }
            }
         }
         break;
      case 20:
         ComboBox var26 = (ComboBox)var2;
         if (var14 != null) {
            var29 = zase.C(var14);
            if (var29 > 0) {
               var26.a(var29 - 1);
            }
         }

         if (var15 != null) {
            var26.setDropDownLines(zase.C(var15));
         }

         if (var16 != null) {
            var29 = var16.size();
            if (var29 > 0) {
               var26.a = new String[var29];

               for(int var33 = 0; var33 < var29; ++var33) {
                  var24 = (String)var16.get(var33);
                  var26.a[var33] = var24;
               }
            }
         }
         break;
      case 24:
         ((OleObject)var2).setAutoSize(var5);
      }

      boolean var34 = true;
      byte var35;
      if (var3) {
         if (var4) {
            var35 = 2;
         } else {
            var35 = 1;
         }
      } else if (var4) {
         var35 = 2;
      } else {
         var35 = 0;
      }

      if (var2.getMsoDrawingType() == 25) {
         var2.setPlacement(var35);
      }

      if (var2.getMsoDrawingType() != 25 && var19 != null && this.i == null) {
         var2.a(var35, zase.C(var19[2]), (double)zase.C(var19[3]), zase.C(var19[0]), (double)zase.C(var19[1]), zase.C(var19[6]), (double)zase.C(var19[7]), zase.C(var19[4]), (double)zase.C(var19[5]));
      }
   }

   private void g(zcfl var1, Shape var2) {
      String var3 = zase.a((zcfq)var1, (String)"dashstyle");
      String var4 = zase.a((zcfq)var1, (String)"linestyle");
      MsoLineFormat var5 = var2.getLineFormat();
      if (var5.isVisible()) {
         if (var4 != null) {
            var5.setStyle(zase.q(var4));
         }

         if (var3 != null) {
            if (var3.indexOf(32) == -1) {
               var5.setDashStyle(zase.r(var3));
            } else if ("1 1".equals(var3)) {
               var5.setDashStyle(7);
            } else if ("0 2".equals(var3)) {
               var5.setDashStyle(5);
            }
         }

      }
   }

   private Color a(String var1, WorksheetCollection var2) {
      Color var3 = Color.getEmpty();

      try {
         int var4 = var1.indexOf(91);
         int var5 = var1.indexOf(93);
         if (var4 != -1 && var5 != -1 && var2 != null) {
            int var6 = zase.C(var1.substring(var4 + 1, var4 + 1 + (var5 - var4 - 1)));
            var3 = var2.m().e(var6);
         } else {
            if (var1.charAt(0) != '#') {
               switch(m.a(var1.toLowerCase())) {
               case 45:
                  return Color.getBlack();
               case 46:
                  return Color.getSilver();
               case 47:
                  return Color.getGray();
               case 48:
                  return Color.getWhite();
               case 49:
                  return Color.getMaroon();
               case 50:
                  return Color.getRed();
               case 51:
                  return Color.getPurple();
               case 52:
                  return Color.getFuchsia();
               case 53:
                  return Color.getGreen();
               case 54:
                  return Color.getLime();
               case 55:
                  return Color.getOlive();
               case 56:
                  return Color.getYellow();
               case 57:
                  return Color.getNavy();
               case 58:
                  return Color.getBlue();
               case 59:
                  return Color.getTeal();
               case 60:
                  return Color.getAqua();
               default:
                  return Color.getEmpty();
               }
            }

            if (var1.length() == 4) {
               var1 = "#" + var1.charAt(1) + var1.charAt(1) + var1.charAt(2) + var1.charAt(2) + var1.charAt(3) + var1.charAt(3);
            }

            var3 = zase.t(var1.substring(1));
         }
      } catch (Exception var7) {
         ;
      }

      return var3;
   }

   ArrayList b() {
      return this.g;
   }
}
